package org.fhm.zdte.common.protocol;


/**
 * The abstract layer for parse Packet-Data and Packet-Message.
 *
 * @author 谭波
 * @since 2023/10/31
 */
public abstract class AbstractMessageParser {

    /**
     * Encode Packet-Message to Packet-Data.
     *
     * @param message Packet-Message
     * @return Packet-Data
     */
    public abstract byte[] encoding(AbstractMessageStandard message);

    /**
     * Decode Packet-Data to Packet-Message.
     *
     * @param buffer Packet-Data.
     * @return Packet-Message.
     */
    public abstract AbstractMessageStandard decoding(byte[] buffer);

}
